//
//  Person.m
//  05_homeWork
//
//  Created by 402030900@qq.com on 16/7/8.
//  Copyright © 2016年 402030900@qq.com. All rights reserved.
//

#import "Person.h"

@implementation Person
-(instancetype)initWithName:(NSString *)personName Age:(NSInteger)personAge Sex:(NSString *)personSex{
    self = [super init];
    if (self) {
        _name = personName;
        _age = personAge;
        _sex = personSex;
    }
       return self;
}
-(NSString *)description{
   return [NSString stringWithFormat:@"%@,%ld,%@",_name,_age,_sex];
}
-(NSComparisonResult)compareNames:(Person *)element{
 return [_name compare:element.name];
}
-(NSComparisonResult)compareAges:(Person *)element{
  // return [[NSNumber numberWithInteger:_age compare:[NSNumber numberWithInteger:element.age]];
    return 0;
}


-(NSComparisonResult)compareSexs:(Person *)element{
    return [_sex compare:element.sex];
}
@end
